package com.itheima.entity;

import java.util.Date;

public class Account {

    // 基本数据类型
    private Integer id;
    private String name;
    private double money;
    // 引用数据类型
    private Date birthday;

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public Account() {
        System.out.println("account对象产生了");
    }
    public Account(Integer id, String name, double money) {
        System.out.println("三个参数的构造方法");
        this.id = id;
        this.name = name;
        this.money = money;
    }
    public Account(Integer id, String name) {
        System.out.println("两个参数的构造方法");
        this.id = id;
        this.name = name;
        this.money = 0;
    }


    public void initMethod(){
        System.out.println("初始时自动调用");
    }

    public void destoryMethod(){
        System.out.println("对象销毁时，自动调用");
    }


    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", money=" + money +
                ", birthday=" + birthday +
                '}';
    }

    //此处省略set和get方法


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}